---
title: 'typescript'
sidebar:
  order: 21
  title: typescript
---

Parent: [main.js|ts configuration](./main-config.mdx)

Type:

<IfRenderer renderer="react">
  ```ts
  {
    check?: boolean;
    checkOptions?: CheckOptions;
    reactDocgen?: 'react-docgen' | 'react-docgen-typescript' | false;
    reactDocgenTypescriptOptions?: ReactDocgenTypescriptOptions;
    skipCompiler?: boolean;
  }
  ```
</IfRenderer>

<IfRenderer renderer={['angular', 'vue', 'web-components', 'ember', 'html', 'svelte', 'preact', 'qwik','solid' ]}>
  ```ts
  {
    check?: boolean;
    checkOptions?: CheckOptions;
    skipCompiler?: boolean;
  }
  ```
</IfRenderer>

Configures how Storybook handles [TypeScript files](../../configure/integration/typescript.mdx).

## `check`

Type: `boolean`

Optionally run [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin). Note that because this uses a Webpack plugin, it is only available when using the [Webpack builder](../../builders/webpack.mdx).

{/* prettier-ignore-start */}

<CodeSnippets path="main-config-typescript-check.md" />

{/* prettier-ignore-end */}

## `checkOptions`

Type: `CheckOptions`

Options to pass to `fork-ts-checker-webpack-plugin`, if [enabled](#check). See [docs for available options](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/v4.1.6/README.md#options).

{/* prettier-ignore-start */}

<CodeSnippets path="main-config-typescript-check-options.md" />

{/* prettier-ignore-end */}

<IfRenderer renderer="react">
  ## `reactDocgen`

  Type: `'react-docgen' | 'react-docgen-typescript' | false`

  Default:

  * `false`: if `@storybook/react` is not installed
  * `'react-docgen'`: if `@storybook/react` is installed

  Configures which library, if any, Storybook uses to parse React components, [react-docgen](https://github.com/reactjs/react-docgen) or [react-docgen-typescript](https://github.com/styleguidist/react-docgen-typescript). Set to `false` to disable parsing React components. `react-docgen-typescript` invokes the TypeScript compiler, which makes it slow but generally accurate. `react-docgen` performs its own analysis, which is much faster but incomplete.

  {/* prettier-ignore-start */}

  <CodeSnippets path="main-config-typescript-react-docgen.md" />

  {/* prettier-ignore-end */}

  ## `reactDocgenTypescriptOptions`

  Type: `ReactDocgenTypescriptOptions`

  Configures the options to pass to `react-docgen-typescript-plugin` if `react-docgen-typescript` is enabled. See [docs for available options](https://github.com/hipstersmoothie/react-docgen-typescript-plugin).

  {/* prettier-ignore-start */}

  <CodeSnippets path="main-config-typescript-react-docgen-typescript-options.md" />

  {/* prettier-ignore-end */}
</IfRenderer>

## `skipCompiler`

Type: `boolean`

Disable parsing of TypeScript files through the compiler, which is used for Webpack5.

{/* prettier-ignore-start */}

<CodeSnippets path="main-config-typescript-skip-compiler.md" />

{/* prettier-ignore-end */}
